package com.demo.mybatis_plus.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.demo.mybatis_plus.mapper.UserinfoMapper;
import com.demo.mybatis_plus.pojo.PetInfo;
import com.demo.mybatis_plus.pojo.Userinfo;
import org.springframework.stereotype.Service;

@Service
public class UserinfoService extends ServiceImpl<UserinfoMapper, Userinfo> {

    /**
     * 根据手机号码查询用户信息
     *
     * @param phone
     * @return
     */
    public Userinfo getByPhone(String phone) {
        QueryWrapper q = new QueryWrapper();
        q.eq("phone", phone);
        return this.getBaseMapper().selectOne(q);
    }
}
